<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>generate</title>
</head>
<body>
<script>
  /*
  * yield扮演着return的作用 只是可以多次使用
  * */

  function* getValue(){
    yield 'a'
    yield 'b'
    yield 'c'
  }

  let ge = getValue()
  console.log(ge.next());

  console.log('--');

/*  for (let string of ge) {
    console.log(string);
  }*/

  let arr = [0,...ge]
  console.log(arr);
</script>
</body>
</html>